package com.hjc.test;

import com.hjc.service.Equip;
import com.hjc.service.Player;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class PlayerSpring {
    public static void main(String[] args){

        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");

        Player player = (Player)context.getBean("zhangsan");
        Equip equip = player.getRing();
        System.out.println(equip.getName()+"[速度增效:"+equip.getSpeedPlus()+"；攻击增效:"+equip.getAttackPlus()+"；防御增效:"+equip.getDefencePlus()+"]");


        System.out.println("==========升级指环==========");
        player.updateEquip(equip);
        System.out.println("=========升级指环结束=========");

        System.out.println(equip.getName()+"[速度增效:"+equip.getSpeedPlus()+"；攻击增效:"+equip.getAttackPlus()+"；防御增效:"+equip.getDefencePlus()+"]");
    }


}

